﻿
@{
    ViewData["Title"] = "AddView";
    Layout = null;
}
    @*<link href="~/layui-v2.5.6/layuis/layui.css" rel="stylesheet" />*@    
    <link href="~/layui/css/layui.css" rel="stylesheet" />

    @*引用*@
    <script src="~/Scripts/jquery-3.4.1.min.js"></script>
    <script src="~/layui/layui.js"></script>
<div style="width:800px">
    <form class="layui-form" action="/Payment/Add">
      <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
          <input type="text" name="Title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">付款金额</label>
        <div class="layui-input-block">
          <input type="text" name="PaymentPrice" required  lay-verify="required" placeholder="请输入付款金额" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">结算方式</label>
        <div class="layui-input-block">
          <input type="radio" name="PaymentType" value="微信支付" title="微信支付">
          <input type="radio" name="PaymentType" value="支付宝支付" title="支付宝支付">
          <input type="radio" name="PaymentType" value="银联支付" title="银联支付">
          <input type="radio" name="PaymentType" value="企业转账" title="企业转账">
          <input type="radio" name="PaymentType" value="线下支付" title="线下支付">
          <input type="radio" name="PaymentType" value="其它" title="其它">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label" >支付对象</label>
        <div class="layui-input-block">
          <input type="text" name="PaymentObject" required  lay-verify="required" placeholder="请输入支付对象" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label" >开户行</label>
        <div class="layui-input-block">
          <input type="text" name="Bank" required  lay-verify="required" placeholder="请输入开户行" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">银行账户</label>
        <div class="layui-input-block">
          <input type="text" name="BankAccount" required  lay-verify="required" placeholder="请输入银行账户" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">付款日期</label>
        <div class="layui-input-block">
          <input type="text" name="PaymentTime" required  lay-verify="required" placeholder="请输入付款日期" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">用途描述</label>
        <div class="layui-input-block">
          <input type="text" name="PurposePescription" required  lay-verify="required" placeholder="请输入用途描述" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
          <textarea name="Remarks" placeholder="请输入备注" class="layui-textarea"></textarea>
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">票据附件</label>
        <div class="layui-input-block">
            <div class="layui-upload-drag" id="test10">
              <i class="layui-icon">&#xe67c;</i>
              <p>点击上传，或将文件拖拽到此处</p>
            </div>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" type="submit" lay-submit >立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary" onclick="fh()">返回</button>
        </div>
      </div>
    </form>
</div>

<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  form.render();
  //监听提交

  form.on('submit(formDemo)', function(data){
  });
});
function fh(){
    window.parent.location.reload();
    var index = parent.layer.getFrameIndex(window.name);parent.layer.close(index);
}

layui.use('upload', function(){
  var $ = layui.jquery
  ,upload = layui.upload;  
  //拖拽上传
  upload.render({
    elem: '#test10'
    ,url: '/upload/'
    ,accept: 'file' //普通文件
    ,done: function(res){
      //如果上传失败
      if(res.code > 0){
        return layer.msg('上传失败');
      }
      //上传成功
    }
    ,error: function(){
      //演示失败状态，并实现重传
      var demoText = $('#demoText');
      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
      demoText.find('.demo-reload').on('click', function(){
        uploadInst.upload();
      });
    }
  });
  
});
</script>